package com.zy.explore.user.interfaces.facade.v1;

import com.zy.explore.common.interfaces.frm.CommonIdFrm;
import com.zy.explore.order.interfaces.feign.OrderFeign;
import com.zy.explore.order.interfaces.vo.OrderVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * description
 *
 * @author ZY
 * @date 2021年01月22日 11:38
 **/
@Api(tags = "Feign测试(独立)")
@RestController
@RequestMapping("/api")
public class TestUserStandaloneFeignFacade {

    /**
     * 使用独立的feign测试
     */
    @Resource
    private OrderFeign orderFeign;

    @ApiOperation("测试按ID查找")
    @GetMapping("/testFindById")
    public OrderVO test1() {
        System.out.println("通过独立feign依赖调用测试成功");
        return orderFeign.findById(CommonIdFrm.builder().id("1").build());
    }

}
